<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>box</title>
    <style>
        .box {
            background: lightgray;
            width: 300px;
            height: 300px;
            /*padding: 10px;    !*4个方向全为10px*!*/
            /*padding: 10px 20px 30px 40px;  !*方向为上右下左*!*/
            /*padding: 10px 20px;  !*上下为10px，左右20px*!*/
            padding-top: 10px;  /*上*/
            padding-bottom: 10px;  /*下*/
            padding-left: 20px;     /*左*/
            padding-right: 20px;    /*右*/
            border-left: 2px purple solid;    /*实线*/
            border-bottom: 2px green dashed;  /*虚线*/
            border-right: 2px brown dotted;   /*点线*/
            /*margin: 20px;*/
            margin: 10px auto;  /*左右外边距设置为自动，可以实现居中效果*/
        }
        .c1 {
            display: block;   /*转换成块级元素，以便设置大小*/
            width: 200px;
            height: 100px;
            background: #0a469c;
        }
        .left {
            background: lightblue;
            width: 600px;
            height: 100px;
            float: left;
        }
        .right {
            background: lightseagreen;
            width: 600px;
            height: 100px;
            float: right;
        }
    </style>
</head>
<body>
<div>
    <div class="left">left</div>
    <div class="right">right</div>
</div>


<span class="c1">Hello World!</span>

<div class="box">
this is a box model
</div>
</body>
</html>